pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
    // TODO: 这里写逻辑
    // todo!()
    let mut result: u32 = 0;
    let mut i: u32 = 0;

    loop {
        let fib = fibonacci(i);
        if fib > threshold {
            break;
        }
        if fib % 2 == 1 {
            result += fib;
        }
        i += 1;
    }

    result
}

fn fibonacci(n: u32) -> u32 {
    if n == 0 { return 0 };
    if n == 1 { return 1 };
    return fibonacci(n - 1) + fibonacci(n - 2);
}
